package com.wxw.gulidemo.client;

import com.wxw.gulidemo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author by xxz       客户端利用openFeign调用微服务的接口
 * @date 2022/6/13
 */
@Component
@FeignClient(value = "service-vod",fallback = VodClientImpl.class)//指定调用哪个微服务和哪个兜底方法类
public interface VodClient {

    //service-vod微服务中的方法: 根据视频id删除阿里云视频
    //ps: @PathVariable(value = "id"---必须指定)
    //ps: DeleteMapping(---全映射)
    @DeleteMapping("eduVod/video/removeAliyunVideoById/{id}")
    R removeAliyunVideoById(@PathVariable("id") String id);

    //根据id list集合批量删除视频
    @DeleteMapping("eduVod/video/removeBatch")
    R removeBatch(@RequestParam("videoIdList") List<String> videoIdList);
}
